import request from '@/api/myRequest'
//获取订单列表
function findOrdersByPageApi(start, limit, data) {
  return request({
    url: `/lejuAdmin/order/findOrdersByPage/${start}/${limit}`,
    method: 'POST',
    data
  })
}
// 获取订单详情
function orderDetailApi(orderId) {
  return request({
    url: `/lejuAdmin/order/orderDetail/${orderId}`,
    method: 'GET'
  })
}
//获取退单列表
function findReturnApplyApi(start, limit, data) {
  return request({
    url: `/lejuAdmin/orderReturn/findReturnApply/${start}/${limit}`,
    method: 'POST',
    data
  })
}
// 获取退单详情
function orderReturnApi(id) {
  return request({
    url: `/lejuAdmin/orderReturn/${id}`,
    method: 'GET'
  })
}
//地址列表
function addressListApi() {
  return request({
    url: `/lejuAdmin/companyAddress/addressList`,
    method: 'GET'
  })
}
//新增地址
function saveApi(data) {
  return request({
    url: `/lejuAdmin/companyAddress/save`,
    method: 'POST',
    data
  })
}
//收货默认地址
function setReceiveOneApi(data) {
  return request({
    url: `/lejuAdmin/companyAddress/setReceiveOne`,
    method: 'POST',
    data
  })
}
//发货默认地址
function setSendOneApi(data) {
  return request({
    url: `/lejuAdmin/companyAddress/setSendOne`,
    method: 'POST',
    data
  })
}
//编辑地址
function updateApi(data) {
  return request({
    url: `/lejuAdmin/companyAddress/update`,
    method: 'POST',
    data
  })
}
//删除地址
function companyAddressApi(id) {
  return request({
    url: `/lejuAdmin/companyAddress/${id}`,
    method: 'DELETE'
  })
}
//地址详情
function addressListApis(id) {
  return request({
    url: `/lejuAdmin/companyAddress/${id}`,
    method: 'GET'
  })
}
//同意退货
function agreeApplyApi(id, data) {
  return request({
    url: `/lejuAdmin/orderReturn/agreeApply/${id}`,
    method: 'POST',
    data
  })
}
//拒绝退货
function rejectApplyApi(id, data) {
  return request({
    url: `/lejuAdmin/orderReturn/rejectApply/${id}`,
    method: 'POST',
    data
  })
}
//收到退货
function receiveProductApi(id, data) {
  return request({
    url: `/lejuAdmin/orderReturn/receiveProduct/${id}`,
    method: 'POST',
    data
  })
}
//确认发货
function sendDoneApi(data) {
  return request({
    url: `/lejuAdmin/order/sendDone`,
    method: 'POST',
    data
  })
}
export default {
  sendDoneApi,
  receiveProductApi,
  rejectApplyApi,
  agreeApplyApi,
  addressListApis,
  companyAddressApi,
  updateApi,
  setReceiveOneApi,
  setSendOneApi,
  saveApi,
  addressListApi,
  orderReturnApi,
  orderDetailApi,
  findOrdersByPageApi,
  findReturnApplyApi
}
